1
2
3
4
5
6
7
8
9 package ca.uhn.cache.util;
10
11 import org.jmock.core.Invocation;
12 import org.jmock.core.matcher.InvokedRecorder;
13
14
15 /***
16 * Allows a method to eb invoked zero or more times.
17 *
18 * @author <a href="mailto:alexei.guevara@uhn.on.ca">Alexei Guevara</a>
19 * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:01 $ by $Author: bryan_tripp $
20 */
21 public class InvokeAnyMatcher extends InvokedRecorder {
22
23 /***
24 * {@inheritDoc}
25 */
26 public boolean matches( Invocation theInvocation ) {
27 return true;
28 }
29
30 /***
31 * {@inheritDoc}
32 */
33 public void verify() {
34 }
35
36 /***
37 * {@inheritDoc}
38 */
39 public boolean hasDescription() {
40 return true;
41 }
42
43 /***
44 * {@inheritDoc}
45 */
46 public StringBuffer describeTo( StringBuffer theBuffer ) {
47 theBuffer.append("expected zero or more");
48 if (hasBeenInvoked()) {
49 theBuffer.append(" and has been invoked");
50 }
51 return theBuffer;
52 }
53
54 }